<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php e($html->charset()); ?>
<title><?php __($sitename); e(' &rsaquo; '); __($title_for_layout); ?></title>
<?php
  if (is_array($stylesheet)) {
      foreach ($stylesheet as $css) {
          e($html->css($css));
      }
  }
?>
</head>
<body>

<div>
  <div style="height:10px;"></div>
  <div id="status" style="display:none;"></div>
  <div class="body" style="padding-top:28px;">
    <div class="mainmenu fLeft" style="top:38px; padding:3px 8px 8px; -moz-border-radius:8px; -webkit-border-radius:8px;">
      <div style="margin:0 auto 10px; width:132px;"><img src="<?php e($this->base); ?>/img/logo.png" /></div>
      <div style="padding-left:3px;">
        <a href="<?php e($this->base); ?>/pages/home" class="mainmenu split"><?php __('HOME'); ?></a>
        <a href="<?php e($this->base); ?>/pages/aboutus" class="mainmenu split"><?php __('ABOUT US'); ?></a>
        <a href="javascript:showSublinks(1);" class="mainmenu nolink"><?php __('PRODUCT'); ?></a>
          <div class="split">
            <div id="sublinks1" class="<?php echo isset($category)?'':'hide'; ?>">
              <a href="<?php e($this->base); ?>/products/condom" class="submenu" style="padding-top:8px;"><?php __('Condom'); ?></a>
              <a href="<?php e($this->base); ?>/products/accesories" class="submenu " style="padding-bottom:8px;"><?php __('Accesories'); ?></a>
            </div>
          </div>
        <a href="<?php e($this->base); ?>/albums" class="mainmenu split"><?php __('EVENT'); ?></a>
        <a href="javascript:showSublinks(2);" class="mainmenu nolink"><?php __('GALLERY'); ?></a>
          <div class="split">
            <div id="sublinks2" class="<?php echo isset($isGallery)?'':'hide'; ?>">
              <a href="javascript:;" class="mainmenu nohover"><?php __('"Take Care Of Me"'); ?></a>
               <a href="<?php e($this->base); ?>/galleries" class="submenu" style="padding-top:8px;"><?php __('View Photo'); ?></a>
               <a href="<?php e($this->base); ?>/upload/gallery" class="submenu" style="padding-bottom:8px;"><?php __('Enter Contest'); ?></a>
            </div>
          </div>
        <a href="<?php e($this->base); ?>/products/shopping" class="mainmenu split"><?php __('SHOPPING'); ?></a>
        <a href="<?php e($this->base); ?>/wallpapers" class="mainmenu split"><?php __('WALLPAPER'); ?></a>
        <a href="<?php e($this->base); ?>/pages/contact" class="mainmenu split"><?php __('CONTACT US'); ?></a>
        <div id="admin-panel" style="display:<?php echo ($admin)?'block':'none'; ?>;">
          <a href="<?php e($this->base); ?>/orders/history" class="mainmenu split" style="padding-bottom:8px;"><?php __('MANAGE ORDERS'); ?></a>
          <a href="<?php e($this->base); ?>/links/manage" class="mainmenu split" style="padding-bottom:8px;"><?php __('MANAGE LINKS'); ?></a>
          <a href="<?php e($this->base); ?>/images/manageSlides" class="mainmenu split" style="padding-bottom:8px;"><?php __('MANAGE SLIDES'); ?></a>
          <a href="<?php e($this->base); ?>/albums/manage/" class="mainmenu split"><?php __('MANAGE EVENTS'); ?></a>
          <a href="<?php e($this->base); ?>/galleries/manage/" class="mainmenu split"><?php __('MANAGE GALLERY'); ?></a>
          <a href="<?php e($this->base); ?>/wallpapers/manage" class="mainmenu split"><?php __('MANAGE WALLPAPER'); ?></a>
          <a href="<?php e($this->base); ?>/members/password" class="mainmenu split" style="padding-bottom:8px;"><?php __('CHANGE PASSWORD'); ?></a>
          <a href="<?php e($this->base); ?>/members/logout" class="mainmenu split"><?php __('LOGOUT'); ?></a>
        </div>
        <div id="member-panel" style="display:<?php echo ($logged && !$admin)?'block':'none'; ?>;">
          <a href="<?php e($this->base); ?>/members/update" class="mainmenu split" style="padding-bottom:8px;"><?php __('ACCOUNT INFORMATION'); ?></a>
          <a href="<?php e($this->base); ?>/members/password" class="mainmenu split" style="padding-bottom:8px;"><?php __('CHANGE PASSWORD'); ?></a>
          <a href="<?php e($this->base); ?>/orders/history" class="mainmenu split" style="padding-bottom:8px;"><?php __('VIEW ORDER HISTORY'); ?></a>
          <a href="<?php e($this->base); ?>/members/logout" class="mainmenu split"><?php __('LOGOUT'); ?></a>
        </div>
        <div id="login-panel" style="margin-top:20px; color:#58595B; display:<?php echo ($logged)?'none':'block'; ?>;">
          <form id="form-login" action="<?php e($this->base); ?>/members/login" method="post" onsubmit="return login();">
            ID <input type="text" id="username" name="username" class="input" style="width:100px; font-size:10px; padding:1px; margin-left:4px;" />
            PW <input type="password" id="password" name="password" class="input" style="width:100px; font-size:10px; padding:1px; margin-top:3px;" />
            <center><input type="submit" value="Login" style="font-weight:bold; margin-top:2px ; font-size:10px;" /></center>
          </form>
          <div id="login-status" style="display:none; text-align:center;"><?php __('logging..'); ?></div>
        </div>
        <div style="margin-top:10px;">
          <a href="http://www.facebook.com/pages/Care-Condom/33255662221?ref=ts"><img src="<?php e($this->base); ?>/img/facebookico.gif" style="border:0;" /></a>
          <a class="addthis_button" addthis:ui_offset_top="138" addthis:ui_offset_left="-36" addthis:ui_click="true"
           href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4b5583313a4d0062"><img src="<?php e($this->base); ?>/img/ShareThisico.gif" alt="Bookmark and Share" style="border:0;" /></a>
          <a class="addthis_button_favorites"><img src="<?php e($this->base); ?>/img/BookmarkThisPageico.gif" alt="Bookmark and Share" /></a>
          <a href="mailto:hann@carelatex.com"><img src="<?php e($this->base); ?>/img/Emailico.gif" style="border:0;" /></a>
<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b5583313a4d0062"></script>
        </div>
<style type="text/css">
<!--
#at15s {
    width: 130px !important;
}
#at-logo {
    display: none;
}
-->
</style>
      </div>
    </div>
    <div class="content fLeft">
      <div id="message" style="display:none; margin-top:10px; margin-left:30px;"></div>
<?php if ($session->check('Message.flash') || $session->check('Message.auth')) { ?>
      <div id="messageBox" style="margin-bottom:5px; margin-left:30px;"><?php $session->flash().$session->flash('auth'); ?></div>
      <div class="clear"></div>
<?php } else if ($session->check('Message.email')) { ?>
      <div id="messageBox" style="margin-bottom:5px; margin-left:30px;"><?php $session->flash('email'); ?></div>
      <div class="clear"></div>
<?php } ?>
<?php e($content_for_layout); ?>
    </div>
    <div class="clear"></div>
  </div>
  <div class="footer">
<?php
      $copyright = $html->link('&copy;', '/', array('style'=>'background-color:transparent;'), false, false);
      e(r(
          array('%copyright%', '%date%', '%sitename%', '%version%'),
          array($copyright, date('Y'), __($sitename,true), '1.0'),
          __('Copyright %copyright% %date% CARE&trade LATEX %version%;. All rights reserved.', true)
      ));
?>
  </div>
</div>
<?php
  if (is_array($javascripts)) {
      foreach ($javascripts as $js) {
          e($javascript->link($js));
      }
  }
?>

<script type="text/javascript"><?php e($scripts_for_layout); ?></script>
<div style="color:#ccc;">
  <?php e($cakeDebug); ?>
</div>

<script>
function init2 () {
    setTimeout(function(){
    var o_css  = document.createElement('link');
    o_css.type = 'text/css';
    o_css.rel  = 'stylesheet'
    o_css.href = '<?php e($this->base); ?>/css/addthis.css';
    document.getElementsByTagName('head')[0].appendChild(o_css);
    }, 2000);
} // init2

function message (msg, focus) {
    alert(msg);

    if (typeof focus != 'undefined') {
        Ext.fly(focus).focus();
    }
} // message

function showSublinks (no) {
    var s = (no == 1) ? 2 : 1;

    Ext.fly('sublinks'+no).slideIn('t', {
        easing: 'easeOut'
    });
    if (Ext.fly('sublinks'+s).isVisible()) {
        Ext.fly('sublinks'+s).slideOut('t', {
            easing: 'easeOut',
            useDisplay: true
        });
    }
} // showSublinks

function login () {
    var form_log = Ext.query('input', 'form-login');
    var user_id  = Ext.get('username');
    var password = Ext.get('password');

    if (!user_id.getValue()) {
        message('Please enter your user id', 'username');
        return false;
    }
    if (!password.getValue()) {
        message('Please enter your password', 'password');
        return false;
    }

    transId = Ext.Ajax.request({
        form: 'form-login',
        method: 'POST',
        success: function(response, opts) {
            var obj = Ext.decode(response.responseText);
            if (typeof obj != 'object') {
                message('Something is wrong, would you mind to try again later?', 'username');
                return false;
            } else if (obj.status == false) {
                var mesg = (obj.mesg) ? obj.mesg : 'Login failure, please try again..';
                password.dom.value = '';
                message(mesg, 'username');
                return false;
            } else {
                if (obj.role == 'A') {
                    Ext.fly('admin-panel').slideIn('t', { easing:'easeOut' });
                } else {
                    Ext.fly('member-panel').slideIn('t', { easing:'easeOut' });
                }
                Ext.fly('login-panel').setStyle({ display:'none' });
            }
        },
        failure: function(response, opts) {
            message('server-side failure with status code '+response.status);
        },
        callback: function() {
            Ext.fly('status').slideOut('t', {
                easing: 'easeOut',
                useDisplay: true
            });
            Ext.fly('login-status').setStyle({ display:'none' });
            Ext.fly('form-login').fadeIn();
        }
    });

    if (Ext.Ajax.isLoading(transId)) {
        Ext.fly('status').update('Logging..');
        Ext.fly('status').slideIn('t', {
            easing: 'easeOut'
        });
        Ext.fly('form-login').setStyle({ display:'none' });
        Ext.fly('login-status').fadeIn();
    }

    return false;
} // login

//init();
</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-4779606-15");
pageTracker._trackPageview();
} catch(err) {}</script>

</body>
</html>